<h:panelGroup xmlns:h='http://java.sun.com/jsf/html'
              xmlns:f='http://java.sun.com/jsf/core'
              xmlns:p='http://primefaces.org/ui'
              xmlns:z='http://savanti.com.bo/ui' styleClass='ITPedidoImport' id='ITPedidoImport'><p:growl id='growl'/>

<p:toolbar styleClass='toolBar'>

<p:toolbarGroup style='width:100%;height:40px'>

<p:commandButton icon='ui-icon-new'  title='Nuevo'   actionListener='#{ITPedidoImport.uiClean}' update='@(.ITPedidoImport)' style='width:70px;border: none;' process='@this'/>

<p:commandButton icon='ui-icon-save' title='Guardar' actionListener='#{ITPedidoImport.save}' update='@(.ITPedidoImport)' style='width:70px;border: none;' process='@this'/>

<p:commandButton id='#{formId}btnTitle' value='PEDIDOS' style='width:10%;position:absolute;left:40%;background: transparent;border: none;font-weight: bold' actionListener='#{ITPedidoImport.uiForm}'  update='@(.ITPedidoImport)' process='@this'/>

<p:fileUpload label='' auto='true' update='ITPedidoImport' fileUploadListener='#{ITPedidoImport.updateMaster}' dragDropSupport='true' mode='avanced' allowTypes='/(\.|\/)(xls|xlsx)$/' style='width:100px;height:5px;float:right'/>

</p:toolbarGroup>

</p:toolbar>


<p:dataTable id='tblPrd' value='#{ITPedidoImport.lsEntity}' var='x' paginator='true' paginatorPosition='bottom' rows='500' resizableColumns='true' rendered='#{not empty ITPedidoImport.lsEntity}'

             rowIndexVar='rowInd' paginatorAlwaysVisible='false' emptyMessage='' style="width:100%;background: transparent">

<p:columnGroup type='header'>

<p:row>

<p:column headerText='Codigo'/>

<p:column headerText='Material'/>

<p:column headerText='Cantidad'/>

</p:row>

</p:columnGroup>


<p:subTable var='d' value='#{x.lsPedidoDetalle}'>

<f:facet name='header'>

<h:outputText value='#{x.cliente.codigo} - #{x.cliente.persona.nombre}'/>

<h:outputText value='#{x.fecha}' style='float:right'><f:convertDateTime pattern='dd-MM-yyyy'/></h:outputText>

</f:facet>


<p:column><h:outputText value='#{d.material.codigo}'/></p:column>

<p:column><h:outputText value='#{d.material.nombre}'/></p:column>

<p:column><z:outputN v='#{d.cantidad}' r='0'/></p:column>

</p:subTable>

</p:dataTable>

</h:panelGroup>  